$().ready(function() {
// 在键盘按下并释放及提交后验证提交表单
    $("#defaultForm").validate({
        errorPlacement: function(error, element) {
            if(element.parent().children().length == 3){
                error.appendTo(element.parent().parent().parent().parent());
            }else{
                error.appendTo(element.parent());
            }
        },
        rules: {
            singer_id: {
                required: true,
            },
            music_id: {
                required: true
            }


        },
        messages: {
            singer_id: {
                required: "请输入歌手名",
            },
            music_id: {
                required: "请上传图片",
            }
        }
    })
});